Skip to contentSkip to conversation

New: r300g MSAA breaks Half-Life 2 in Wine

Bug 59322 [email protected] 1 participant 13 messages Jan 13, 2013 – Jul 30, 2013

lore
Share & tools
lore
#0 lore raw

https://bugs.freedesktop.org/show_bug.cgi?id=59322

Priority: medium
Bug ID: 59322
Assignee: [email protected]
Summary: r300g MSAA breaks Half-Life 2 in Wine
Severity: normal
Classification: Unclassified
OS: All
Reporter: [email protected]
Hardware: Other
Status: NEW
Version: git
Component: Drivers/Gallium/r300
Product: Mesa

When MSAA is enabled in Half-Life 2 running in Wine, the window only contains garbled output. Disabling multisampling in Wine or in the game settings restores proper rendering.

A complication is that the game enables 2x MSAA by default if it is available. A user not knowing this fact will think that 8ed6b140 broke the game. It also makes disabling multisampling in the game settings a challenge.

Hardware info:
OpenGL vendor string: X.Org R300 Project OpenGL renderer string: Gallium 0.4 on ATI RV530 OpenGL version string: 2.1 Mesa 9.1-devel (git-8ed6b14) OpenGL shading language version string: 1.20

01:00.0 VGA compatible controller: Advanced Micro Devices [AMD] nee ATI M56P [Radeon Mobility X1600]
01:00.0 0300: 1002:71c5

Signature · 2 lines
You are receiving this mail because:
You are the assignee for the bug.

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel

#1 lore raw

[Bug 59322] r300g MSAA breaks Half-Life 2 in Wine

https://bugs.freedesktop.org/show_bug.cgi?id=59322

--- Comment #1 from Stefan Dösinger <[email protected]> --- MSAA basically works on this GPU. GALLIUM_MSAA=2 glxgears renders correctly, is slower than glxgears without MSAA and the gear edges look smoother, although it is hard to tell if glxgears is antialiased or not.

Signature · 2 lines
You are receiving this mail because:
You are the assignee for the bug.

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel

#2 lore raw

[Bug 59322] r300g MSAA breaks Half-Life 2 in Wine

In reply to [email protected]

https://bugs.freedesktop.org/show_bug.cgi?id=59322

--- Comment #2 from Marek Olšák <[email protected]> --- Could you please attach a screenshot of the issue.

Signature · 2 lines
You are receiving this mail because:
You are the assignee for the bug.

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel

#3 lore raw

[Bug 59322] r300g MSAA breaks Half-Life 2 in Wine

In reply to [email protected]

https://bugs.freedesktop.org/show_bug.cgi?id=59322

--- Comment #3 from Marek Olšák <[email protected]> --- Also, are there any GL errors?

Signature · 2 lines
You are receiving this mail because:
You are the assignee for the bug.

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel

#4 lore raw

[Bug 59322] r300g MSAA breaks Half-Life 2 in Wine

In reply to [email protected]

https://bugs.freedesktop.org/show_bug.cgi?id=59322

--- Comment #4 from Stefan Dösinger <[email protected]> --- Created attachment 72999
--> https://bugs.freedesktop.org/attachment.cgi?id=72999&action=edit
Screenshot

It looks just like a dump from /dev/random, but here you go :-)

I noticed that the driver seems to reject the multisampled framebuffer during draws, clears and blits:

err:d3d_draw:drawStridedFast >>>>>>>>>>>>>>>>> GL_INVALID_FRAMEBUFFER_OPERATION (0x506) from glDrawElementsBaseVertex @ ../../../wine-git/dlls/wined3d/drawprim.c / 63 fixme:d3d:context_check_fbo_status FBO status GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT (0x8cd6)
fixme:d3d:context_check_fbo_status Location SFLAG_INRB_MULTISAMPLE
(0x200000).
fixme:d3d:context_check_fbo_status Color attachment 0: (0x186090)
WINED3DFMT_B8G8R8A8_UNORM 800x600 2 samples.
fixme:d3d:context_check_fbo_status Depth attachment: (0x186210)
WINED3DFMT_D24_UNORM_S8_UINT 800x600 2 samples.

The problem affects other applications as well, including 3DMark2000(which does not support multisampling itself) when run with GALLIUM_MSAA=2.

Signature · 2 lines
You are receiving this mail because:
You are the assignee for the bug.

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel

#5 lore raw

[Bug 59322] r300g MSAA breaks Half-Life 2 in Wine

In reply to [email protected]

https://bugs.freedesktop.org/show_bug.cgi?id=59322

--- Comment #5 from Marek Olšák <[email protected]> ---
I think this is an issue which should probably be fixed in Wine. There must be something wrong with the FBO setup. The Mesa function which marks the attachment(s) as incomplete is test_attachment_completeness.

Signature · 2 lines
You are receiving this mail because:
You are the assignee for the bug.

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel

#6 lore raw

[Bug 59322] r300g MSAA breaks Half-Life 2 in Wine

In reply to [email protected]

https://bugs.freedesktop.org/show_bug.cgi?id=59322

--- Comment #6 from Stefan Dösinger <[email protected]> --- I'll have a look at this function and see which check we fail, but I have my doubts that it is Wine's fault. This code works fine on all other drivers - nvidia, fglrx, r600g, osx drivers.

Also keep in mind that MSAA in Wine apps fails if Wine doesn't request the multisampling, but it is enabled with GALLIUM_MSAA=n. I don't see how this can possibly be a fault in Wine.

Signature · 2 lines
You are receiving this mail because:
You are the assignee for the bug.

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel

#7 lore raw

[Bug 59322] r300g MSAA breaks Half-Life 2 in Wine

In reply to [email protected]

https://bugs.freedesktop.org/show_bug.cgi?id=59322

--- Comment #7 from Marek Olšák <[email protected]> ---
Yes, the GALLIUM_MSAA environment variable might break some apps, because it changes the default framebufer to MSAA, which adds lots of limitations to BlitFramebuffer. For example, you can no longer use BlitFramebuffer to do a stretched blit, because the ARB_fbo specification doesn't allow it if either src or dst is multisample, etc.

That's why GALLIUM_MSAA should be used carefully.

Signature · 2 lines
You are receiving this mail because:
You are the assignee for the bug.

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel

#8 lore raw

[Bug 59322] r300g MSAA breaks Half-Life 2 in Wine

In reply to [email protected]

https://bugs.freedesktop.org/show_bug.cgi?id=59322

--- Comment #8 from Marek Olšák <[email protected]> ---
I have found the problem. Wine is trying to use the GL_SRGB8_ALPHA8 format, which is not supported for rendering by the driver internally, but I agree the format should be allowed in the API. The fix is on the way.

Is it a big deal that ARB_framebuffer_sRGB is unsupported? In such a case, the renderbuffer format GL_SRGB8_ALPHA8 is equivalent to GL_RGBA8.

Signature · 2 lines
You are receiving this mail because:
You are the assignee for the bug.

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel

#9 lore raw

[Bug 59322] r300g MSAA breaks Half-Life 2 in Wine

In reply to [email protected]

https://bugs.freedesktop.org/show_bug.cgi?id=59322

--- Comment #9 from Stefan Dösinger <[email protected]> --- (In reply to comment #8)

Quoted 2 lines

Is it a big deal that ARB_framebuffer_sRGB is unsupported? In such a case, the renderbuffer format GL_SRGB8_ALPHA8 is equivalent to GL_RGBA8.

Not really. In this case we generate code in the pixel shader that performs sRGB color conversion as specified in the framebuffer_sRGB spec.

Do r300-r500 GPUs have some dedicated silicon to handle sRGB conversion? If so, it'd be nice to use it.

Signature · 2 lines
You are receiving this mail because:
You are the assignee for the bug.

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel

#10 lore raw

[Bug 59322] r300g MSAA breaks Half-Life 2 in Wine

In reply to [email protected]

https://bugs.freedesktop.org/show_bug.cgi?id=59322

--- Comment #10 from Stefan Dösinger <[email protected]> --- Fwiw, there's probably a bug in Wine as well. We shouldn't try to render to sRGB formats if framebuffer_sRGB is not supported, but giving textures an sRGB format is the only way to make use of sRGB_decode.

Signature · 2 lines
You are receiving this mail because:
You are the assignee for the bug.

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel

#11 lore raw

[Bug 59322] r300g MSAA breaks Half-Life 2 in Wine

In reply to [email protected]

https://bugs.freedesktop.org/show_bug.cgi?id=59322

--- Comment #11 from Marek Olšák <[email protected]> ---
It's okay to render to an sRGB texture, but FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING should return LINEAR on r300g. That doesn't affect texturing though.

Signature · 2 lines
You are receiving this mail because:
You are the assignee for the bug.

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel

#12 lore raw

[Bug 59322] r300g MSAA breaks Half-Life 2 in Wine

In reply to [email protected]

https://bugs.freedesktop.org/show_bug.cgi?id=59322

Marek Olšák <[email protected]> changed:

What |Removed |Added
----------------------------------------------------------------------------

             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #12 from Marek Olšák <[email protected]> --- Fixed by
http://cgit.freedesktop.org/mesa/mesa/commit/?id=1302c66896e6fbdb4eeb086d41901ddaeb89513f
Closing.

Signature · 2 lines
You are receiving this mail because:
You are the assignee for the bug.

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel